using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Daniel.Core.Models.Mapping
{
    public class TBatchContentMap : EntityTypeConfiguration<TBatchContent>
    {
        public TBatchContentMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.BATCHID)
                .HasMaxLength(50);

            this.Property(t => t.BATCHFILETITLE)
                .HasMaxLength(200);

            this.Property(t => t.BatchFiled)
                .HasMaxLength(100);

            this.Property(t => t.BATCHLOCATION)
                .HasMaxLength(40);

            this.Property(t => t.BATCHCATEGORY)
                .HasMaxLength(40);

            this.Property(t => t.BATCHPERIOD)
                .HasMaxLength(40);

            this.Property(t => t.BATCHLOADMETHOD)
                .HasMaxLength(200);

            this.Property(t => t.BATCHFILEDATE)
                .HasMaxLength(100);

            this.Property(t => t.BATCHFILEEXTENSION)
                .HasMaxLength(20);

            this.Property(t => t.BATCHFILEPATH)
                .HasMaxLength(1000);

            // Table & Column Mappings
            this.ToTable("TBatchContent");
            this.Property(t => t.BATCHID).HasColumnName("BATCHID");
            this.Property(t => t.BATCHFILETITLE).HasColumnName("BATCHFILETITLE");
            this.Property(t => t.BatchFiled).HasColumnName("BatchFiled");
            this.Property(t => t.BATCHLOCATION).HasColumnName("BATCHLOCATION");
            this.Property(t => t.BATCHCATEGORY).HasColumnName("BATCHCATEGORY");
            this.Property(t => t.BATCHPERIOD).HasColumnName("BATCHPERIOD");
            this.Property(t => t.BATCHLOADMETHOD).HasColumnName("BATCHLOADMETHOD");
            this.Property(t => t.BATCHFILEDATE).HasColumnName("BATCHFILEDATE");
            this.Property(t => t.BATCHFILEEXTENSION).HasColumnName("BATCHFILEEXTENSION");
            this.Property(t => t.BATCHFILEPATH).HasColumnName("BATCHFILEPATH");
            this.Property(t => t.BATCHPOVVALID).HasColumnName("BATCHPOVVALID");
            this.Property(t => t.PARTITIONKEY).HasColumnName("PARTITIONKEY");
            this.Property(t => t.CATKEY).HasColumnName("CATKEY");
            this.Property(t => t.PERIODKEY).HasColumnName("PERIODKEY");
            this.Property(t => t.ID).HasColumnName("ID");
        }
    }
}
